/**
 * A class representing a pair of values. A pair is immutable. 
 * 
 * @author remo.lemma@lu.unisi.ch
 */

package ch.unisi.inf.projects.java.uom;

public final class Pair<L,R> {

	/** Left value */
	private final L left;
	
	/** Right value */
	private final R right;
	
	public Pair(final L left,final R right)
	{
		this.left = left;
		this.right = right;
	}

	/**
	 * Returns the left value
	 * @return the left value of the Pair
	 */
	public L getLeft()
	{
		return this.left;
	}
	
	/**
	 * Returns the right value
	 * @return the right value of the Pair
	 */
	public R getRight()
	{
		return this.right;
	}
	
	/**
	 * Checks if the pair is null (left and right values are null)
	 * @return true if the pair is null, false otherwise
	 */
	public boolean isNull ()
	{
		return (this.right == null && this.left == null);
	}
}